const obj={
    _name:"why",
    get name(){
        return this._name
    },
    set name(newVaue){
        this._name = newVaue
    }
}

const objProxy = new Proxy(obj,{
    get:function(target,key,receiver){
        //receiver是创建出来的代理对象
        // console.log(receiver)
        // console.log(receiver === objProxy)
        console.log("get方法被访问------")
       return Reflect.get(target,key,receiver)
    },
    set:function(target,key,newValue,receiver){
        console.log("set方法被访问------")
        Reflect.set(target,key,newValue,receiver)
    }
})



objProxy.name = "kobe"
console.log(objProxy.name)